<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta name="screen-orientation" content="portrait">
    <meta name="x5-orientation" content="portrait">
    <title>收银员信息</title>
    <link rel="stylesheet" href="../../styles/h5/reset.min.css"/>
    <link rel="stylesheet" href="../../styles/h5/errortankuang.css"/>
    <!--以上为公共css样式-->
    <link rel="stylesheet" href="../../styles/h5/index.css"/>

    <script charset="utf-8" type="text/javascript" src="../../scripts/h5/jquery-1.9.1.min.js"></script>
    <script charset="utf-8" type="text/javascript" src="../../scripts/h5/jquery.modal.js"></script>
    <!--以上为公共js文件-->
</head>
<body>
<div class="zz-top"></div>
<div class="zz-list">
    <ul>
        <li>
            <a href="javascript:;">
                <span class="zz-bank">收银员姓名</span>
                <span class="zz-replace  zz-name">张三</span>
            </a>
        </li>
        <li>
            <a href="javascript:;">
                <span class="zz-left">联系电话</span>
                <span class="zz-replace  zz-phone-num"></span>
            </a>
        </li>
    </ul>
</div>
<input class="footer bg zz-footTop" type="button" value="删除收银员">
<div class="zz-mask" style="display: none"></div>
</body>

<script charset="utf-8" type="text/javascript" src="../../scripts/h5/utils.js"></script>
<script charset="utf-8" type="text/javascript" src="../../scripts/h5/index.js"></script>
<script charset="utf-8" type="text/javascript">
    var queryURLParameter = utils.queryURLParameter();
    $(".zz-name").html(queryURLParameter.name);
    $(".zz-phone-num").html(queryURLParameter.telephoneNo);
    var userId = queryURLParameter.userId;
    $footer.click(function () {
        $(".zz-mask").show();
        //$footer.attr("disabled", "true");
        new $.modal({
            title: '提示',//弹框title
            content: '是否删除该收银员',//弹框内容
            isshowclosebtn: true,//是否显示取消按钮
            showcontent: false,//false为弹出框组件二，true为弹出框组件一
            closecallback: function () {
                $(".zz-mask").hide();
            },//点击关闭时触发事件
            surecallback: function () {
                //点击确定时触发事件
                new $.modal({
            		content: "加载中",
            		animation: true//调用动画
        		}).show();
                
                $.ajax({
                    url: utils.ajaxUrl()+"h5/cashier/receiver/delCashier",
                    async: false,
                    data: {
                        userId: userId
                    },
                    type: 'get',
                    success: function (res) {
                        if (res && res.retCode == '0000') {
                        	new $.modal({
            					animation: true,//调用动画
        					}).hide(0);
        					
                            new $.modal({
                                content: '收银员已成功删除！',//弹框内容
                                showcontent: true,//false为弹出框组件二，true为弹出框组件一

                            }).show(2000);
                            
                            //$footer.attr("disabled", "true");
                            window.setTimeout(function () {
                                $mask.hide();
                                window.location.href = "../../html/h5/cashierAdmin.html?storeId=" + queryURLParameter.storeId + "&toreShortName=" + queryURLParameter.toreShortName;
                                //$footer.removeAttr("disabled");
                                new $.modal({
            						animation: true,//调用动画
        						}).hide();
                            }, 2000);
                        } else {
                            $mask.hide();
                            new $.modal({
            					animation: true,//调用动画
        					}).hide(0);
                            new $.modal({
                                content: res.retMsg,//弹框内容
                                showcontent: true,//false为弹出框组件二，true为弹出框组件一
                            }).show($footer);
                            
                        }
                    }
                });
            }
        }).show();
    })
</script>
</html>